import request from '@/utils/request'
import Cookies from 'js-cookie'

// 获取列表
export function getList(data) {
    return request({
        url: '/Ims_send_orders/purchase_send_order_list',
        method: 'post',
        data: data
    })
}

// 发货单关闭
export function orderClose(data) {
    return request({
        url: '/Ims_send_orders/purchase_send_order_close',
        method: 'post',
        data: data
    })
}
// 发货包关闭
export function packageClose(data) {
    return request({
        url: '/Ims_send_orders/purchase_send_package_close',
        method: 'post',
        data: data
    })
}
// 发货包确认
export function packageConfirm(data) {
    return request({
        url: '/Ims_send_orders/purchase_send_package_confirm',
        method: 'post',
        data: data
    })
}
// 发货单下载
export function getExport(data) {
    // window.location.href = `http://dev.hahaipi.com/smsi/index.php/Ims_send_orders/package_print?package_id=${data.package_id}&didixueshengka=${Cookies.get('SMS_AdminToken')}`; 
    window.location.href = `https://${location.host}/smsi/index.php/Ims_send_orders/package_print?package_id=${data.package_id}}&didixueshengka=${Cookies.get('SMS_AdminToken')}`; 
}